//
//  SphereNode.swift
//  MazeGame
//
//  Created by orienthong on 2018/12/19.
//  Copyright © 2018 OrientHong. All rights reserved.
//

import SceneKit

class SphereNode: SCNNode {
    var x: Int
    var y: Int
    init(x: Int, y: Int) {
        self.x = x
        self.y = y
        super.init()
    }
    
    func configureNode() {
        let sphere = SCNSphere(radius: 0.5)
        sphere.firstMaterial?.lightingModel = .physicallyBased
        sphere.firstMaterial?.metalness.contents = UIImage(named: "art.scnassets/gold-scuffed-metal.png")
        sphere.firstMaterial?.normal.contents = UIImage(named: "art.scnassets/gold-scuffed-normal.png")
        sphere.firstMaterial?.roughness.contents = UIImage(named: "art.scnassets/gold-scuffed-roughness.png")
        self.geometry = sphere
        self.position = SCNVector3Make(Float(x), 0.5, Float(y))
    }
    
    func startAnimation() {
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
